<?php
class Admin_Form_User extends Zend_Form
{
    public function init()
    {
       
        $this->setMethod('post');
        $this->setName('user');
        $this->setAction('');
        
        $this->addElement('text','imie',array(
            'label' => "imię",
            'filters' => array('StringTrim'),
            'validators' => array(
                array(
                'validator' => 'StringLength',
                'options'   => array(2, 20)
                    )
                
            ),
            'required' => true
                   
        ));
       
        $this->addElement('text','nazwisko',array(
            'label' => "nazwisko",
            'filters' => array('StringTrim'),
            'validators' => array(
                array(
                'validator' => 'StringLength',
                'options'   => array(2, 30)
                    )
                
            ),
            'required' => true
                   
        ));
        
        $this->addElement('text','login',array(
            'label' => "login",
            'filters' => array('StringTrim'),
            'validators' => array(
                array(
                'validator' => 'StringLength',
                'options'   => array(2, 30)
                    )
                
            ),
            'required' => true
                   
        ));
        
        $this->addElement('password','haslo',array(
            'label' => "hasło",
            'filters' => array('StringTrim'),
            'validators' => array(
                array(
            'validator' => 'StringLength',
            'options'   => array(4, 32)
            ),
                array('validator' => 'Alnum')                
                ),
            'required' => true
                   
        ));
        
        
        $this->addElement('password','p_haslo',array(
            'label' => "potwierdź hasło",
            'filters' => array('StringTrim'),
            'validators' => array(
                array(
            'validator' => 'StringLength',
            'options'   => array(4, 32)
            ),
                array('identical',true,array('token'=>'haslo'))
                ),
            'required' => true
        ));
        
        $this->addElement('text','mail',array(
            'label' => "e-mail",
            'filters' => array('StringTrim'),
            'validators' => array(
             array(
            'validator' => 'StringLength',
            'options'   => array(8, 40)
            ),
            array('validator' =>'EmailAddress')
            
            ),
            'required' => true
        ));
        
          $this->addElement('text','gadugadu',array(
            'label' => "numer gg",
            'required' => false
                   
        ));
          
       
             $this->addElement('text','telefon',array(
            'label' => "numer telefonu",
            'validators' => array(
                 array(
            'validator' => 'StringLength',
            'options'   => array(7, 12)
            )),
            'required' => false
                   
        ));
          
         $this->addElement('textarea','adres',array(
            'label' => "adres zamieszkania",
            'rows' => 6,
            'cols' => 30,
            'maxlength' => 200,
            'validators' => array(
                array(
                'validator' => 'StringLength',
                'options'   => array(5, 200)
                    )
            ),
            'required' => false
                   
        ));
         
         $this->addElement('select','smtp_safety',array(
            'label' => "tryb szyfrowania",
            'multiOptions' => array(
        '2' => 'Member',
        '1' => 'Admin',
        ),
            'required' => true
                   
        ));
             
       
           
             
             $this->addElement('submit','submit',array(
            'label' => "Wyślij"
            
        ));
             
             
    }
}
?>
